<?php
/**
 * @version $Id: unocloud_joostina_keywords_plugin.php 2 2010-05-25 10:13:33Z vladzimirs $
 * @package UnoCloud
 * @copyright Авторские права (C) 2009-2010 UnoCloud team & (C) 2007-2010 Joostina team &. Все права защищены.
 * @license Лицензия http://www.gnu.org/licenses/gpl-2.0.htm GNU/GPL, или help/license.php
 * UnoCart! - свободное программное обеспечение распространяемое по условиям лицензии GNU/GPL
 * Для получения информации о используемых расширениях и замечаний об авторском праве, смотрите файл help/copyright.php.
 */

defined('_VALID_MOS') or die('Restricted access');
$descr = "Joostina Content Keywords Plugin"; //short information about plugin


global $database, $my;

if (($runMe) && ($loadKey)) {
    //content
    $database->setQuery("SELECT metakey FROM #__content WHERE state=1");
    if ($cur = $database->query()) {
        while ($row = mysql_fetch_object($cur)) {
            $metaKey .= "," . $row->metakey;
            if ($this->cacheTag($stag, $metaKey)) {
                $stag = null;
                $metaKey = null;
            }
        }
    }
}
/*
//under construction

if (($runSearch)&&(!empty($search)))
{
$nullDate 	= $database->getNullDate();
$now 		= _CURRENT_SERVER_TIME;
$order = 'a.created ASC';
echo($row->metakey."<br>");
$where= "LOWER(a.metakey) LIKE LOWER('%".$row->metakey."%')";
$query = "SELECT a.title AS title,"
. "\n a.created AS created,"
. "\n CONCAT(a.introtext, a.fulltext) AS text,"
. "\n CONCAT_WS( '/', u.title, b.title ) AS section,"
. "\n CONCAT( 'index.php?option=com_content&task=view&id=', a.id ) AS href,"
. "\n '2' AS browsernav,"
. "\n 'content' AS type"
. "\n, u.id AS sec_id, b.id as cat_id"
. "\n FROM #__content AS a"
. "\n INNER JOIN #__categories AS b ON b.id=a.catid"
. "\n INNER JOIN #__sections AS u ON u.id = a.sectionid"
. "\n WHERE ( $where )"
. "\n AND a.state = 1"
. "\n AND u.published = 1"
. "\n AND b.published = 1"
. "\n AND a.access <= " . (int) $my->gid
. "\n AND b.access <= " . (int) $my->gid
. "\n AND u.access <= " . (int) $my->gid
. "\n AND ( a.publish_up = " . $database->Quote( $nullDate ) . " OR a.publish_up <= " . $database->Quote( $now ) . " )"
. "\n AND ( a.publish_down = " . $database->Quote( $nullDate ) . " OR a.publish_down >= " . $database->Quote( $now ) . " )"
. "\n GROUP BY a.id"
. "\n ORDER BY $order";

//$database->setQuery("SELECT metakey FROM #__content WHERE metakey LIKE '%".$search."%'");
//if ($cur = $database->query()) 
//{
//while ($row = mysql_fetch_object( $cur )) 
//{
$limit=10;
$database->setQuery( $query, 0, $limit );
$results = $database->loadObjectList();

//	}
//}

} */

?>